// -----------------------------------------------------------
// Game Framework
// Copyright © 2024-2024 deadcycle. All rights reserved.
// Homepage: https://deadcycle.gitee.io
// Feedback: deadcycle@163.com
// -----------------------------------------------------------

using UnityEditor;

using UnityEngine;

namespace UIWidget.Editor
{
    [CustomEditor(typeof(FixedScrollRect))]
    public class FixedScrollRectInspector : ScrollRectBaseInspector
    {
        private SerializedProperty m_CellSize;
        private SerializedProperty m_CellTemplate;

        protected override void OnEnable()
        {
            base.OnEnable();

            m_CellSize = serializedObject.FindProperty("m_CellSize");
            m_CellTemplate = serializedObject.FindProperty("m_CellTemplate");
        }

        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            using (new EditorGUILayout.VerticalScope(EditorStyles.helpBox))
            {
                using (new EditorGUILayout.HorizontalScope(EditorStyles.toolbar))
                {
                    GUILayout.Label("<b>定长视图单元格配置</b>", GUIStyleHelper.Caption);
                }

                EditorGUILayout.PropertyField(m_CellSize, new GUIContent("单元格尺寸"), true);
                EditorGUILayout.PropertyField(m_CellTemplate, new GUIContent("单元格模板"), false);

                serializedObject.ApplyModifiedProperties();
            }

            base.OnInspectorGUI();
        }
    }
}